画像処理におけるモーメント

概要

ファイル: \examples\Processing\Geometry\ImageMoments\ImageMoments.va

デフォルトプラットフォーム: mE5-MA-VCL

簡単な説明

入力画像の画像モーメントの方向と離心率を計算します。

画像処理におけるモーメントは、画像の各ピクセルの輝度の平均値です。これらのモーメントを使用することで、画像内のオブジェクトの方向、離心率、面積、重心などの物理的特性を特定できます。

方向

方向 オブジェクトの定義は以下となります。 [Bur06]:

数式 24


二次中心モーメントを使用:

数式 25


定義を使用:

数式 26


重心は以下です。

数式 27


および生モーメントは

数式 28


オブジェクトの面積に対応します。 ここで、g(x,y) はデジタルグレースケール画像のグレースケール関数です。

離心率

オブジェクトの離心率 e は、[Bur06] を用いて計算できます。

数式 29


離心率の結果は、0(円形オブジェクト)から 1(細長いオブジェクト)の範囲になります。

VisualAppletsでの設計

VisualApplets では、オリジナル画像と、オブジェクトの面積、重心、方向、離心率などの幾何学的プロパティを出力とするデザインが実装されています。このサンプルは \examples\Processing\Geometry\ImageMoments\ImageMoments.va にあります。 計算には 4 の Parallelism が選択されています。 図 324「基本的なデザイン構造」に、コメント付きのデザイン構造を示します。

基本設計構造

図 324. 基本的なデザイン構造


グレースケール画像の幾何学的プロパティ(面積、重心、方向、離心率)は、モーメントを介して計算されます(HierarchicalBox: ImageMoments)。 これらのプロパティは、元のカメラ画像に追加されます(AppendMomentsToImage)。 次の項目:フレックス 図325:ImageMomentsのコンテンツ HierarchicalBox ImageMoments を示しています。生モーメント (オブジェクトの面積に対応) および 、および重心 と中心モーメントは および 上記の式に従って実装されています。最後に、画像オブジェクトの主軸の幾何学的Propertyである配向 および離心率eがこれらの結果から計算されます。

ImageMomentsのコンテンツ

図325:ImageMomentsのコンテンツ


では、 図326:HierarchicalBox orientation_thetaのコンテンツ および 図327:HierarchicalBox eccentricityのコンテンツ HierarchicalBoxのコンテンツである orientation_theta および eccentricity が、個々の処理ステップに関するコメントとともに示されています。配向 orientation と離心率 e は、次の値を使用して計算されます。 に従って、 式24 および 式29。 ARCTANオペレーターへの入力信号には、R=7の解像度が選択されています。

HierarchicalBox orientation_thetaのコンテンツ

図326:HierarchicalBox orientation_thetaのコンテンツ


HierarchicalBox eccentricityのコンテンツ

図327:HierarchicalBox eccentricityのコンテンツ


Comment: During implementation of the orientation of Θ it showed, that limitation to 12 bits maximum input signal of the ARCTAN function can be a problem for calculation of accuracy and resolution: for example the image of an ellipse with orientation Θ= 44.07° (result of moment implementation with MATLAB) was analyzed. The 25 bit input signal for the ARCTAN function has to be limited to 12 bits. With resolution of R= 8 bits the implementation in VisualApplets has result 41.43°; with R=7 bits the result is 43.21° (with resolution for small angles of 0.2°) and with R= 6 it is 44.07° (with resolution for small angles of 0.45°). As an result we found that with high resolution (R= 8 bit) the maximum angle of calculation is smaller than the true angle of orientation, due to bit depth limitation. With smaller resolution R the result of calculation improves for big angles but has as an consequence smaller accuracy in the range of small angles. The problem can be solved by using a Lookup table instead of ARC TAN operator.